From: Aleksander Jan Bajkowski Date: Sat, 15 Mar 2025 16:29:02 +0000 (+0100) Subject: luci-mod-status: channel_analysis: fix 6 GHz support X-Git-Url: http://git.openwrt.org/%22https:/collectd.org//%22/%22https:/collectd.org/%22?a=commitdiff_plain;h=62c401ca24fe53d85fdbb7148f7ba14cc4ab4ca1;p=project%2Fluci.git luci-mod-status: channel_analysis: fix 6 GHz support This commit fixes wrong channel width in the 6 GHz band. Now all APs don't show a 20 MHz channel width. Tested on ZyXEL EX5601 with MT7921 USB adapter. Signed-off-by: Aleksander Jan Bajkowski --- diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js index 32eb797dba..cf123d6a98 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/channel_analysis.js @@ -311,7 +311,7 @@ return view.extend({ /* if channel_width <= 40, refer to HT (above) for actual channel width, * as vht_operation.channel_width == 40 really only means that the used * bandwidth is <= 40 and could be 20 Mhz as well */ - if (res.vht_operation != null && res.vht_operation.channel_width > 40) { + if (res.vht_operation?.channel_width > 40) { center_channels[0] = res.vht_operation.center_freq_1; if (res.vht_operation.channel_width == 80) { chan_width = 8; @@ -342,6 +342,29 @@ return view.extend({ } } + if (res.he_operation?.channel_width > 20) { + center_channels[0] = res.he_operation.center_freq_1; + chan_width = res.he_operation.channel_width / 10; + switch (res.he_operation.channel_width) { + case 40: + res.channel_width = "40 MHz"; + break; + case 80: + res.channel_width = "80 MHz"; + break; + case 160: + res.channel_width = "160 MHz"; + center_channels.push(res.he_operation.center_freq_2); + break; + } + } + + if (res.eht_operation?.channel_width == 320) { + chan_width = 32; + res.channel_width = "320 MHz"; + center_channels.push(res.eht_operation.center_freq_2); + } + this.add_wifi_to_graph(chan_analysis, res, scanCache, center_channels, chan_width); rows.push([